package com.example.memolaga;

import java.io.File;

public class Constants {
	
	private static final String S_KEY = "sKey";
    private static final String SEED_KEY ="618970019642690137449562111";
    private static final String END_OF_LINE = "\n";

    private static final int RESULT_NO_EDIT = 0;
    private static final int RESULT_EDIT = 1;

	private static final String DIR_FILE_CONF = "file";
	private static final String FILE_MASTER_PWD ="pwdMaster.txt";

	private static final String PREF_STRING_CARD = "prefSaveCard";			//importante che abbiano key uguale
	private static final String PREF_STRING_CREDENTIAL = "prefSaveCredential";
	private static final String PREF_STRING_ACCOUNT = "prefSaveAccount";
    private static final String PREF_STRING_TIME_EXPIRY = "prefExpiryTime";
    private static final String PREF_STING_SHOW_PASS = "prefShowPass";

    private static final boolean PREF_BOOL_CARD = true;
    private static final boolean PREF_BOOL_CREDENTIAL = true;
    private static final boolean PREF_BOOL_ACCOUNT = true;
    private static final int PREF_TIME_EXPIRY = 120;
    private static final boolean PREF_BOOL_SHOW_PASS = false;

	private static final String HEAD_XML_FILE="<?xml version=\"1.0\"?>";
	private static final String HEAD_OPEN_XML = "<";
	private static final String HEAD_CLOSE_XML = "</";
	private static final String TAIL_XML = ">";

	private static final String FILE_CREDENTIALS = "credentials.xml";
	private static final String CREDENTIALS_ROOT = "credentials";
	private static final String CREDENTIALS_ELEMENT = "dc";
	private static final String CREDENTIALS_NAME = "name";
	private static final String CREDENTIALS_USER = "user";
	private static final String CREDENTIALS_PASS = "pwd";
	private static final String CREDENTIALS_DATE_CREATED = "dateCreated";
	private static final String CREDENTIALS_EXPIRY = "expiry";
	private static final String CREDENTIALS_DATE_LAST_USED = "dateLastUsed";
	private static final String CREDENTIALS_SITE = "site";
	private static final String CREDENTIALS_NOTE = "note";

	private static final String FILE_CARD = "cards.xml";
	private static final String CREDIT_CARDS_ROOT="creditCard";
	private static final String CARD_ELEMENT="cc";
	private static final String CARD_NAME="name";
	private static final String CARD_NUMBER="number";
	private static final String CARD_PIN="pin";
	private static final String CARD_CVV="cvv";
	private static final String CARD_PHONE="phone";
	private static final String CARD_CIRCUITS="circuits";
	private static final String CARD_EXPIRY="expiry";
	private static final String CARD_BALANCE="balance";
    private static final String CARD_HOLDER ="holder";
    private static final String CARD_BILL_ADDRESS="billAddress";
	private static final String CARD_BANK="bank";
	private static final String CARD_WEBSITE="website";
	private static final String CARD_NOTE="note";

    private static final String FILE_ACC = "accounts.xml";
    private static final String ACCOUNT_ROOT = "account";
    private static final String ACCOUNT_ELEMENT = "acc";
    private static final String ACCOUNT_NAME = "name";
    private static final String ACCOUNT_SERVER = "server";
    private static final String ACCOUNT_PATH = "path";
    private static final String ACCOUNT_USERNAME = "username";
    private static final String ACCOUNT_PASSWORD = "password";
    private static final String ACCOUNT_PROVIDER = "provider";
    private static final String ACCOUNT_PROVIDER_WEB_SITE = "providerWebSite";
    private static final String ACCOUNT_PROVIDER_PHONE = "providerPhone";
    private static final String ACCOUNT_NOTE = "note";

	public static String getKeyString() {return S_KEY;}
    public static String getEndOfLine() { return END_OF_LINE;}

    public static int getResultNoEdit() {return RESULT_NO_EDIT;}
    public static int getResultEdit() {return RESULT_EDIT;}
	
	public static String getPrefCard() {return PREF_STRING_CARD;}
	public static String getPrefCredential() {return PREF_STRING_CREDENTIAL;}
	public static String getPrefAccount() {return PREF_STRING_ACCOUNT;}
    public static String getPrefStringTimeExpiry() {return PREF_STRING_TIME_EXPIRY;}
    public static boolean getPrefDefaultCard() {return PREF_BOOL_CARD;}
    public static boolean getPrefDefaultCredential() {return PREF_BOOL_CREDENTIAL;}
    public static boolean getPrefDefaultAccount() {return PREF_BOOL_CREDENTIAL;}
    public static int getPrefTimeExpiry() {return PREF_TIME_EXPIRY;}
    public static String getPrefStringShowPass() {return PREF_STING_SHOW_PASS;}
    public static boolean getPrefDefaultShowPass() {return PREF_BOOL_SHOW_PASS;}
	
	public static String getHeadOpenXML() {return HEAD_OPEN_XML;}
	public static String getHeadCloseXML() {return HEAD_CLOSE_XML;}
	public static String getTailXML() { return TAIL_XML; }
	public static String getHeadXmlFile() { return HEAD_XML_FILE; }
	
	public static String getPathMasterPWD()	{ return DIR_FILE_CONF+File.pathSeparatorChar+FILE_MASTER_PWD;}
	
	public static String getDirFileConf() { return DIR_FILE_CONF; }
	
	public static String getPathCredentialsFile() {return DIR_FILE_CONF+File.pathSeparatorChar+FILE_CREDENTIALS;}
	public static String getCredentialsRoot() {return CREDENTIALS_ROOT;}
	public static String getCredentialsElement() {return CREDENTIALS_ELEMENT;}
	public static String getCredentialsName() {return CREDENTIALS_NAME;}
	public static String getCredentialsUser() {return CREDENTIALS_USER;}
	public static String getCredentialsPass() {return CREDENTIALS_PASS;}
	public static String getCredentialsDateCreated() {return CREDENTIALS_DATE_CREATED;}
	public static String getCredentialsExpiry() {return CREDENTIALS_EXPIRY;}
	public static String getCredentialsDateLastUsed() {return CREDENTIALS_DATE_LAST_USED;}
	public static String getCredentialsSite() {return CREDENTIALS_SITE;}
	public static String getCredentialsNote() {return CREDENTIALS_NOTE;}

	public static String getPathCardFile() { return DIR_FILE_CONF+File.pathSeparatorChar+FILE_CARD; }
	public static String getCreditCardsRoot(){ return CREDIT_CARDS_ROOT; }
	public static String getCardsElement() { return CARD_ELEMENT; }
	public static String getCardsName() { return CARD_NAME; }
	public static String getCardsNumber() { return CARD_NUMBER; }
	public static String getCardsPIN() { return CARD_PIN; }
	public static String getCardsCVV() { return CARD_CVV; }
	public static String getCardsPhone() { return CARD_PHONE; }
	public static String getCardsCircuits() { return CARD_CIRCUITS; }
	public static String getCardsExpiry() { return CARD_EXPIRY; }
	public static String getCardsBalance() { return CARD_BALANCE; }
    public static String getCardHolder() { return CARD_HOLDER; }
    public static String getCardBillAddress() { return CARD_BILL_ADDRESS; }
	public static String getCardsBank() { return CARD_BANK; }
	public static String getCardsWebSite() { return CARD_WEBSITE; }
	public static String getCardsNote() { return CARD_NOTE; }
	
	public static String getPathAccFile() { return DIR_FILE_CONF+File.pathSeparatorChar+FILE_ACC;}
    public static String getAccountRoot() { return ACCOUNT_ROOT;}
    public static String getAccountElement() { return ACCOUNT_ELEMENT;}
    public static String getAccountName() { return ACCOUNT_NAME;}
    public static String getAccountServer() { return ACCOUNT_SERVER;}
    public static String getAccountPath() { return ACCOUNT_PATH;}
    public static String getAccountUsername() { return ACCOUNT_USERNAME;}
    public static String getAccountPassword() { return ACCOUNT_PASSWORD;}
    public static String getAccountProvider() { return ACCOUNT_PROVIDER;}
    public static String getAccountProviderWebSite() { return ACCOUNT_PROVIDER_WEB_SITE;}
    public static String getAccountProviderPhone() { return ACCOUNT_PROVIDER_PHONE;}
    public static String getAccountNote() { return ACCOUNT_NOTE;}

}
